package com.xiaoshi.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaoshi.system.entity.SysMenu;
import com.xiaoshi.exception.PlatformException;
import com.xiaoshi.system.mapper.SysMenuMapper;
import com.xiaoshi.system.service.ISysMenuService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 菜单表 服务实现类
 * </p>
 *
 * @author sen
 * @since 2021-06-28
 */
@Service
public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements ISysMenuService {

    @Override
    public List<SysMenu> findUserPermissions(String username) {
        if(StringUtils.isEmpty(username)) throw new PlatformException("获取菜单表 username 为空");
        return this.baseMapper.findUserPermissions(username);
    }
}
